package com.ruoyi.business.controller;

import com.ruoyi.business.domain.JtProtocolTerms;
import com.ruoyi.business.service.IJtProtocolTermsService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 法律协议
 * @Author Alan Zhang
 * @Date 2025/5/28 15:02
 */
@Controller
@RequestMapping("/legal-agreement/terms")
public class LegalAgreementController {
    private String prefix = "business/terms";

    @Autowired
    private IJtProtocolTermsService jtProtocolTermsService;

    @RequiresPermissions("business:supplier:view")
    @GetMapping("/{lang}/{termsNo}")
    public String view(@PathVariable("lang") String lang, @PathVariable("termsNo") String termsNo, ModelMap modelMap)
    {
        JtProtocolTerms jtProtocolTerms = jtProtocolTermsService.selectJtProtocolTermsByProtocolNumber(termsNo);
        modelMap.put("jtProtocolTerms", jtProtocolTerms);
        return prefix + "/view";
    }
}
